# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pshitt
pkgver=23.dae7931
pkgrel=4
groups=('blackarch' 'blackarch-honeypot')
pkgdesc='A lightweight fake SSH server designed to collect authentication data
sent by intruders.'
arch=('any')
url='https://github.com/regit/pshitt'
license=('GPL3')
depends=('python2' 'python2-paramiko' 'python2-daemon')
makedepends=('git')
source=("git+https://github.com/regit/$pkgname.git")
sha512sums=('SKIP')
install="$pkgname.install"

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/usr/bin/env python|/usr/bin/env python2|' pshitt
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 test_rsa.key "$pkgdir/usr/share/$pkgname/test_rsa.key"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

